Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to understand local a: var label `v'

    Dear All,

    Thank you sincerely for helping me. I read one stata programing book and am struck by the following syntax. I underlined it. How to understand it and why we need to use
    colons in that syntax? I rarely met syntax using colons before, and when shall we need to use it?

    des srate infla ss
    sum srate infla ss
    local vv srate infla ss*
    foreach v of varlist `vv'{
    local a: var label `v'
    if ("`v'"=="infla"|"`v'"=="srate"){
    winsor `v', p(0.02) gen(`v'_x)
    }
    else{
    winsor `v',p(0.01) gen(`v'_x)
    }
    drop `v'
    rename `v'_x `v'
    label var `v' "`a'"
    }

    Best Regards,

    Eddie

  • #2
    It is an extended macro function, see: help extended_fcn
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X